#pragma once
#include <HAPI_lib.h>
#include "Visualisation.h"
#include "Rectangle.h"
class CWorldEntity
{
protected:
	int currentPosX;
	int currentPosY;
	int previousPosX;
	int previousPosY;
	int indexSprite;
	int indexFrame;
	int speed;
	int currentHealth;
	int collisionCost;
	bool active;
	int side;
	CRectangle collisionRectangle;



public:
	CWorldEntity(void);
	virtual CWorldEntity::~CWorldEntity(void);
	virtual void CWorldEntity::update(void)=0;
	virtual void CWorldEntity::render(void)=0;
	virtual int CWorldEntity::getState(void);
	virtual int CWorldEntity::getNumberOfLife(void);
	virtual int CWorldEntity::getTotalHealth(void);
	virtual void CWorldEntity::die(void);

	bool CWorldEntity::checkForCollision(CWorldEntity* otherEntity);
	bool CWorldEntity::isEnemyOf(CWorldEntity* otherEntity);

	int CWorldEntity::getCurrentPosX(void) const;
	int CWorldEntity::getCurrentPosY(void) const;
	int CWorldEntity::getPreviousPosX(void) const;
	int CWorldEntity::getPreviousPosY(void) const;
	int CWorldEntity::getIndexSprite(void) const;
	int CWorldEntity::getIndexFrame(void) const;
	int CWorldEntity::getSpeed(void) const;
	int CWorldEntity::getCurrentHealth(void) const;
	int CWorldEntity::getCollisionCost(void) const;
	bool CWorldEntity::getActive(void) const;
	int CWorldEntity::getSide(void) const;
	CRectangle CWorldEntity::getCollisionRectangle(void)const;

	void CWorldEntity::setCurrentPosX(int posX);
	void CWorldEntity::setCurrentPosY(int posY);
	void CWorldEntity::setPreviousPosX(int posX);
	void CWorldEntity::setPreviousPosY(int posY);
	void CWorldEntity::setIndexSprite(int indexSprite);
	void CWorldEntity::setIndexFrame(int indexFrame);
	void CWorldEntity::setSpeed(int speed);
	void CWorldEntity::setCurrentHealth(int health);
	void CWorldEntity::setCollisionCost(int collisionCost);
	void CWorldEntity::setActive(bool active);
	void CWorldEntity::setSide(int side);
	void CWorldEntity::setCollisionRectangle(CRectangle collisionRectangle);

};
enum {
	STAND_LEFT,
	STAND_RIGHT,
	RUN_LEFT,
	RUN_RIGHT,
	ATTACK_LEFT,
	ATTACK_RIGHT,
	JUMP_LEFT,
	JUMP_RIGHT};

enum{
	eSideNeutral,
	eSidePlayer,
	eSideEnemy
	};